package com.gzy.wb.controller;


import com.gzy.wb.repository.UserRepository;
import com.gzy.wb.model.User;
import com.gzy.wb.server.UserServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
public class TestController {

    @Autowired
    UserServer userServer;

    @RequestMapping(path = "/test",method = RequestMethod.GET)
    String test(){

        return "123";
    }

    @RequestMapping(path = "/getalluser",method = RequestMethod.GET)
    List<User> getalluser(){
        return userServer.findAll();
    }

}
